// pages/previewVisit/previewVisit2/HistoricalQueries/HistoricalQueries.js
Page({
  data: {
    idNumber: '',
    phoneNumber: ''
  },

  onIdInput: function(event) {
    this.setData({
      idNumber: event.detail.value
    });
  },

  onPhoneInput: function(event) {
    this.setData({
      phoneNumber: event.detail.value
    });
  },

  onQuery: function() {
    const { idNumber, phoneNumber } = this.data;
    if (!idNumber || !phoneNumber) {
      wx.showToast({
        title: '请填写所有必填项',
        icon: 'none'
      });
      return;
    }
    // TODO: 进行查询操作
    wx.showToast({
      title: '查询中...',
      icon: 'loading'
    });
  },

  onCancel: function() {
    this.setData({
      idNumber: '',
      phoneNumber: ''
    });
    wx.navigateBack({
      url: '/pages/previewVisit/previewVisit2/previewVisit2'
    });
  }
});